import Taro, { Component } from '@tarojs/taro'
import { View, Text, Button } from '@tarojs/components'
import './index.scss'

export default class InfoBase extends Component {
  static defaultProps = {
    item: {},
    price: {}
  }

  render () {
    const { item = {}, price = {} } = this.props
    const { tagList = [] } = item
    return (
      <View className='base-info'>
        <View className='item-price'>
          <Text className='item-price-a'>¥<Text className='item-price-a-value'>{ price.sellingPrice || item.sellingPrice }</Text>
          </Text>
          {item.marketPrice && <Text className='item-price-b'>¥{ price.marketPrice || item.marketPrice }</Text>}
          <View className='at-icon at-icon-share item-price-share'>
            <Button openType='share' className='item-price-share-but'></Button>
          </View>
        </View>
        <View className='item-title'>
          {tagList.map(tag => <Text className='item-title-tab' >{{tag}}</Text>)}
          { item.itemName }
        </View>
      </View>
    )
  }
}
